﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services;
using Abp.Application.Services.Dto;
using LeadThing.AbpZeroTemplate.Authorization.Users.Dto;
using LeadThing.AbpZeroTemplate.Dto;

namespace LeadThing.AbpZeroTemplate.Authorization.Users
{
    public interface IUserAppService : IApplicationService
    {
        #region 扩展方法

        /// <summary>
        /// 获取所有用户信息加载到前台地图
        /// </summary>
        /// <returns></returns>
        PagedResultDto<UsersLoadPageDto> GetAllUsersLoadPage(GetUsersInput input);

        /// <summary>
        /// 根据条件和角色获取所有用户数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<ListResultDto<UserListDto>> GetAllUsersByWhereAndRole(GetUsersInput input);

        /// <summary>
        /// 根据条件获取所有用户数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<ListResultDto<UserListDto>> GetAllUsersByWhere(GetUsersInput input);

        /// <summary>
        /// 根据UserId获取用户数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<UserEditDto> GetUsersGyUserId(GetUsersInput input);

        #endregion

        #region 用户管理
        Task<PagedResultDto<UserListDto>> GetUsers(GetUsersInput input);

        Task<PagedResultDto<UserCountListDto>> GetUserCountByGroup(GetUsersInput input);

        Task<UserListDto> GetCurrentUserDto();

        Task<FileDto> GetUsersToExcel();

        Task<FileDto> GetUsersByFilterToExcel(GetUsersInput input);

        Task<FileDto> DownloadUsersTemplateExcel();

        Task<GetUserForEditOutput> GetUserForEdit(NullableIdDto<long> input);

        Task<GetUserPermissionsForEditOutput> GetUserPermissionsForEdit(EntityDto<long> input);

        Task ResetUserSpecificPermissions(EntityDto<long> input);

        Task UpdateUserPermissions(UpdateUserPermissionsInput input);

        Task CreateOrUpdateUser(CreateOrUpdateUserInput input);

        Task<ImportUsersResultDto> CreateUsersAsync(ImportUsersInputDto input);

        Task DeleteUser(EntityDto<long> input);

        Task UnlockUser(EntityDto<long> input);
        #endregion

        #region APP接口

        /// <summary>
        /// 根据查询条件获取纠纷类型分页列表
        /// </summary>
        Task<PagedResultDto<UserListDto>> GetPagedUsersAppAsync(GetUsersAPPInput input);

        /// <summary>
        /// 根据UserId获取用户数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<UserEditDto> GetUsersGyUserIdAPP(GetUsersAPPInput input);

        /// <summary>
        /// 编辑用户数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task UpdateUserAPPAsync(UserEditAPPDto input);

        /// <summary>
        /// 用户注册（群众）
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<RegisterDto> CreateUserAPPAsync(UserRegisterAPPDto input);


        /// <summary>
        /// 获取县管理员通讯录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        List<UserListDto> GetCountyAdministratorMailList(GetUsersAPPInput input);

        /// <summary>
        /// 获取乡镇管理员通讯录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        List<UserListDto> GetTownAdministratorMailList(GetUsersAPPInput input);

        /// <summary>
        /// 获取社区管理员通讯录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        List<UserListDto> GetAreaAdministratorMailList(GetUsersAPPInput input);

        /// <summary>
        /// 获取村庄管理员通讯录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        List<UserListDto> GetVillageAdministratorMailList(GetUsersAPPInput input);

        #endregion

    }
}